package com.pubinfo.passbook.api.controller.contract;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.pubinfo.passbook.common.model.dto.contract.FeeListParam;
import com.pubinfo.passbook.common.model.http.baseEntity.Baseinfo;
import com.pubinfo.passbook.common.model.vo.base.JsonResult;
import com.pubinfo.passbook.common.model.vo.contract.FeeCollectionListVo;
import com.pubinfo.passbook.common.service.contract.TContractPaymentItemsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@RestController
@Api(tags = "QGPB-收款管理")
@RequestMapping(value = "feecollection")
public class FeeCollectionBaseController {

    @Resource
    private TContractPaymentItemsService tContractPaymentItemsService;

    /**
     * 4.3.2.1	合同收款列表
     * 公司、合同编码、名称、合同金额、承接部门、已开票金额、已收款金额、未收款金额
     * @param feeListParam
     * @return
     */
    @PostMapping("list")
    @ApiOperation(value = "合同收款列表")
    public JsonResult<IPage<FeeCollectionListVo>> list(@RequestBody FeeListParam feeListParam) {

          return JsonResult.success(tContractPaymentItemsService.getFeeList(feeListParam));
    }


    /**
     * 4.3.2.2	收款入账信息关联  CRM收款完成后将收款凭证同步赔补系统
     * @param paramObj
     * @return
     */
    @PostMapping("associat")
    @ApiOperation(value = "收款入账信息关联")
    public JsonResult<Baseinfo> associat(@RequestBody Object paramObj) {
        System.out.println("associat");
        return null;
    }


    /**
     * 4.3.2.2	收款详情
     * @param paramObj
     * @return
     */
    @PostMapping("detail")
    @ApiOperation(value = "收款详情")
    public JsonResult<Baseinfo> detail(@RequestBody Object paramObj) {
        System.out.println("detail");
        return null;
    }
}
